package com.xiguaji.tiktok.v1.tiktok.music.repository;

import com.xiguaji.tiktok.v1.tiktok.music.model.MusicTypeRelative;
import com.xiguaji.tiktok.v1.tiktok.music.model.es.ESCategory;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface MusicTypeRelativeRepository extends CrudRepository<MusicTypeRelative,Long> {

    List<MusicTypeRelative> findByMid(long mid);


    @Query("SELECT t.name type_name,t.id FROM music_type_relative r left join blogger_type t on r.type_id = t.id")
    List<ESCategory> findByMidForEs(long mid);
}
